package mrHunter.puzzles.math;

public class Puzzle6 {
    public String triangleArea(String input)
    {
        String[] inputArray=input.split(",");
        int a = Integer.valueOf(inputArray[0]);
        int b = Integer.valueOf(inputArray[1]);
        int c = Integer.valueOf(inputArray[2]);
        double d = (a+b+c) / 2f;
        double s;
        s = (float) Math.sqrt(d * (d - a) * (d - b) * (d - c));
        if (a + b > c && a + c > b && c + b > a)
        {
            return String.valueOf(s);
        }
        else {
            return "not a triangle";
        }
    }
}
